//
//  DeviceListModel.h
//  efairy
//
//  Created by 李锋 on 2019/1/14.
//  Copyright © 2019年 East. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <YYModel.h>

NS_ASSUME_NONNULL_BEGIN


//设备信息
@interface DeviceListItem : NSObject
@property (nonatomic, assign) NSInteger efairydevice_id;            //!< 设备编号
@property (nonatomic, copy)   NSString *efairydevice_uuid;          //!< 设备唯一编号
@property (nonatomic, copy)   NSString *efairydevice_name;          //!< 设备名称
@property (nonatomic, copy)   NSString *efairyproject_name;         //!< 项目名称
@property (nonatomic, copy)   NSString *efairydevice_install_time;  //!< 安装时间
@property (nonatomic, copy)   NSString *efairydevice_description;   //!< 设备描述
@property (nonatomic, copy)   NSString *efairydevice_address;       //!< 地址
@property (nonatomic, assign) double efairydevice_location_lat;     //!< 纬度(小数点6位)
@property (nonatomic, assign) double efairydevice_location_lng;     //!< 经度(小数点6位)
@property (nonatomic, assign) NSInteger efairydevice_project_id;    //!< 所属项目ID
@property (nonatomic, copy)   NSString *efairydevice_project_name;  //!< 设备名称
@property (nonatomic, assign) BOOL efairydevice_is_online;          //!< 是否在线，0-否 1-是
@property (nonatomic, assign) NSInteger efairydevice_belong_system; //!< 系统类型，具体状态参考《网络传输协议-表4》
@property (nonatomic, assign) NSInteger efairydevice_device_type_id;//!< 设备类型，具体状态参考《网络传输协议-表5》
// 设备状态，具体状态参考《网络传输协议》设备状态，0-离线 1-火警 2-预警 3-故障 4-启动 5-屏蔽 6-正常
@property (nonatomic, assign) NSInteger efairydevice_state;         //!< 设备状态，(改为参考下面列表)
@property (nonatomic, assign) NSInteger efairydevice_alarm_id;      //!< 0-离线 1-火警 2-预警 3-故障 4-启动 5-屏蔽 6-正常
@property (nonatomic, copy)   NSString *efairydevice_version;       //!< 设备软件版本号2
@property (nonatomic, copy)   NSString *efairydevice_version_date;  //!< 设备软件版本号1
@property (nonatomic, assign) NSInteger efairydevice_csq;          //信号强度值
@property (nonatomic, assign) NSInteger efairydevice_csq_level;    //信号强度0-弱 1-中 2-强
@property (nonatomic, copy)   NSString *efairydevice_type;//设备类型 设备型号加中文名字

-(NSString *)map_state_str;
-(NSString *)ccid;//主id
-(NSString *)uuid_address;//从ID
@end


//通道信息
@interface PassagewayInfo : NSObject<YYModel,NSCoding>
@property (nonatomic, assign) NSInteger cid; // 通道号
@property (nonatomic, copy) NSString *c_name; // 通道名称
@property (nonatomic, copy) NSString *c_value;// 通道数值
@property (nonatomic, assign) NSInteger c_alarm_id;// 通道状态，0-离线 1-火警 2-预警 3-故障 4-启动 5-屏蔽 6-正常
@end


//设备实时状态
@interface DeviceRealTimeInfo :  NSObject<YYModel,NSCoding>
@property (nonatomic, assign) NSInteger efairydevice_alarm_id;// 设备状态，0-离线 1-火警 2-预警 3-故障 4-启动 5-屏蔽 6-正常，优先级:离线 报警  预警  故障 启动 屏蔽 正常
@property (nonatomic, assign) NSInteger efairydevice_is_online; // 设备是否在线：0-否 1-是
@property (nonatomic, assign) NSInteger efairydevice_csq;// 信号强度值
@property (nonatomic, assign) NSInteger efairydevice_csq_level; // 0-弱 1-中 2-强
@property (nonatomic, assign) NSInteger heartbeat_interval;// 心跳间隔秒数
@property (nonatomic, assign) NSInteger audio_on; // 音响模式，0-静音 1-音响
@property (nonatomic, copy) NSString *rt_data_time; // 数据时间
@property (nonatomic, copy) NSMutableArray<PassagewayInfo *> *c_data_list;//通道信息
@end


//设备管理人员
@interface DeviceUserList : NSObject
@property (nonatomic, assign) NSInteger efairyuser_id;       //用户id
@property (nonatomic, copy)   NSString *efairyuser_nickname;  //s名字
@property (nonatomic, copy) NSString *efairyuser_phonenumber;//手机号
@property (nonatomic, assign) NSInteger is_charger;    //是否管理员
@end


//设备相关
@interface DeviceListModel : NSObject<YYModel,NSCoding>
@property(nonatomic,assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<DeviceListItem *> *device_list;
@property (nonatomic, strong) DeviceListItem *basic_info;
@property (nonatomic, strong) NSMutableArray<NSString *> *efairydevice_imgurl_list;
@property (nonatomic, strong) DeviceRealTimeInfo *rt_info;
@property (nonatomic, strong) NSMutableArray<DeviceUserList *> *user_list;

@end


NS_ASSUME_NONNULL_END
